#include<iostream>
#include<string>
#include<vector>
#include<cmath>
#include<algorithm>
using namespace std;

class Icalculator{
    public:
        virtual void add()=0;
        virtual void sub()=0;
        virtual void mul()=0;
        virtual ~Icalculator(){};
};


class  calculator:public Icalculator{

    private:
        vector<int> res1, res2;
        vector<int> output;
        int len1,len2;

    public:
        calculator (string bignum1,string bignum2){
            len1=bignum1.length();
            len2=bignum2.length();
            for (char c : bignum1) {
                res1.push_back(c - '0');  
            }
            for (char c : bignum2) {
                res2.push_back(c - '0');
            }
           
        }
        void add(){
             output.resize(max(len1,len2)+1,0);
            int i=len1-1,j=len2-1,And=0;
            int L=max(len1,len2);
            while(i>=0 || j>=0){
              if (i >=0 ) And += res1[i--];
                if (j >=0) And += res2[j--];
                output[L--]=And%10;
                And/=10;
            }
            if(And>0){
                output[L]=And;
            }
            int start=0;
            while(start<output.size() && output[start]==0){
                start++;
            }
            for(int k=start;k<output.size();k++){
                cout<<output[k];
            }
        }

        void sub(){
            int ifbitter=0;
            vector<int> num1,num2;
            if(len1>len2){
                ifbitter=1;
                }
            if(len1<len2){
                ifbitter=2;
            }
            else if(len1==len2){
                for(int i=0;i<len1;i++){
                    if(res1[i]>res2[i]){
                        ifbitter=1;
                        break;
                    }
                    else if(res1[i]<res2[i]){
                        ifbitter=2;
                        break;
                    }
                }
            }
            vector<int> output;
                if(ifbitter==1){
                    num1=res1;
                    num2=res2;
                     reverse(num1.begin(), num1.end());
                  reverse(num2.begin(), num2.end());
                }
                  for(int i=0;i<len1;i++){
                   if(num1[i]>=num2[i]){
            output.push_back(num1[i]-num2[i]);
    }
    else{
        output.push_back(10+num1[i]-num2[i]);
        num1[i+1]--;
    }
    reverse(output.begin(), output.end());
   }
   int start=0;
   while(start<output.size()&&output[start]==0){
    start++;
   }
   for(int i=start;i<output.size();i++){
cout<<output[i];
   }
   if(ifbitter==2){
    int start=0;
   while(start<output.size()&&output[start]==0){
    start++;
   }
   cout<<"-";
     for(int i=start;i<output.size();i++){
cout<<output[i];
}
        }
    }

    void mul(){
        reverse(res1.begin(), res1.end());
        reverse(res2.begin(), res2.end());
    vector<int> output(len1+len2,0);
    for(int i=0;i<len1;i++){
        for(int j=0;j<len2;j++){
            output[i+j]+=res1[i]*res2[j];
    }
}
    for(int i=0;i<len1+len2;i++){
        if(output[i]>9){
            output[i+1]+=output[i]/10;
            output[i]%=10;
        }else{
continue;
        }
    }
    reverse(output.begin(), output.end());
    int start=0;
    while(start<output.size()&&output[start]==0){
        start++;        }
        string result;
    for(int i=start;i<output.size();i++){
        result+=to_string(output[i]);
    }
    cout<<result;
    }
};


int main(){
    string bignum1,bignum2;
    cin>>bignum1>>bignum2;
    Icalculator* c=new calculator(bignum1,bignum2);
    c->add();
    c->sub();
    c->mul();
    delete c;
    return 0;
}

